<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>02_元素消失方式</title>
    <style>
        div {
            width: 200px;
            height: 200px;
        }
        .d1 {
            background-color: lightgreen;
        }
        .d1:hover {
            /*脱离文档流释放布局空间*/
            display: none;
        }
        .d2 {
            background-color: lightpink;
        }
        .d2:hover {
            /*缩小到看不见*/
            transform: scale(0);
        }
        .d3 {
            background-color: lightcoral;
        }
        .d3:hover {
            /*只能将背景色修改为透明色*/
            background-color: rgba(0,0,0,0);
        }
        .d4 {
            background-color: lightsalmon;
        }
        .d4:hover {
            /* 修改透明度至看不见 */
            opacity: 0;
        }
    </style>
</head>
<body>
    <div class="d1">111</div>
    <div class="d2">222</div>
    <div class="d3">333</div>
    <div class="d4">444</div>
</body>
</html>